import type { TANPANCHA_DATA_SOURCE_TYPE, TANPANCHA_TYPE } from '@/constant/modules/tanpancha'

export interface GasInfoVo {
  id: number
  gas: string
  emissionFactor: number
  emissionUnitFactor: string
  gwp: number
  discountValue: number
  data: number
  dataToCO2: number
  ratio: string
}

export interface FacilityActivityVo {
  id: number
  name: string
  emissionSource: string
  emissionType: TANPANCHA_TYPE
  sourceType: TANPANCHA_DATA_SOURCE_TYPE
  data: number
  ratio: string
  unit: string
  yearNum: number
  dataExplain: string
  gasExplain: string
  updateTime: string
  gasList: GasInfoVo[]
}

export interface CategoryDetailVo {
  id: number
  name: string
  xh: string
  categoryType: number
  data: number
  ratio: string
  facilityActivityList: FacilityActivityVo[]
}

export interface CategoryVo {
  id: number
  name: string
  xh: string
  range: string
  categoryType: number
  data: number
  ratio: string
  categoryList: CategoryDetailVo[]
}

export interface GWP {
  gas: string
  gwp: number
}

export interface InventoryReportDetail {
  carbonInventoryId: number
  year: string
  enterpriseName: string
  pointName: string
  reportCreationTime: string
  carbonEmissionsTotalNum: number
  carbonEmissionsUnit: string
  gasTypes: string
  category: string[]
  categoryCount: number
  data: number
  ratio: string
  emissionIntensity: string
  dataList: CategoryVo[]
  gwpList: GWP[]
}

/** 设施活动及排放源列表数据对象 */
export interface FacilityActivityTableListItem {
  [key: string]: any
  /** 类别 */
  categoryName: string
  /** 子类别 */
  subCategoryName: string
  /** 设施/活动 */
  activityName: string
  /** 排放源 */
  activityEmissionSource: string
}

/** 温室气体GWP值列表对象 */
export type GWPTableListItem = GWP

/** 排放源活动数据列表对象 */
export type EmissionSourceActivityTableListItem = Omit<FacilityActivityVo, 'gasList'>

/** 活动排放因子列表对象 */
export interface ActivityGasEmissionFactorTableListItem {
  [key: string]: any
  /** 设施/活动 */
  activityName: string
  /** 排放源 */
  activityEmissionSource: string
  /** 活动数据单位 */
  activityUnit: string
  CO2: number | string
  CH4: number | string
  N2O: number | string
  HFCs: number | string
  PFCs: number | string
  SF6: number | string
  NF3: number | string
}

/** 温室气体排放量及占比列表对象 */
export interface GasRatioTableListItem {
  [key: string]: any
  /** 范围 */
  range: string
  /** 类别 */
  categoryName: string
  /** 子类别 */
  subCategoryName: string
  /** 排放量 */
  emission: number
  /** 排放量占比 */
  emissionRatio: string
}

/** 气体排放总量对象 */
export interface GasTotalEmission {
  CO2: number | string
  CH4: number | string
  N2O: number | string
  HFCs: number | string
  PFCs: number | string
  SF6: number | string
  NF3: number | string
  total: number | string
}

/** 活动温室气体排放量及占比列表对象 */
export interface ActivityGasRatioTableListItem {
  [key: string]: any
  /** 子类别 */
  subCategoryName: string
  /** 设施/活动 */
  activityName: string
  /** 排放量 */
  emissionNum: number | string
  /** 排放占比 */
  emissionRatio: number | string
}

/** 类别气体排放量列表对象 */
export interface CategoryGasEmissionTableListItem {
  [key: string]: any
  /** 类别 */
  categoryName: string
  CO2: number | string
  CH4: number | string
  N2O: number | string
  HFCs: number | string
  PFCs: number | string
  SF6: number | string
  NF3: number | string
  total: number | string
}

/** 附录活动气体排放因子说明列表对象 */
export interface ActivityGasInfoTableListItem extends GasInfoVo {
  activityName: string
  activityEmissionSource: string
  activitySourceType: TANPANCHA_DATA_SOURCE_TYPE
  ActivityGasExplain: string
  [key: string]: any
}

/** 大类/小类排放量TOP3 */
export interface CategoryEmissionRank {
  xh: string
  name: string
  data: number
  ratio: string
}

/** 气体排放量TOP3 */
export interface GasEmissionRank {
  gas: string
  data: number
  ratio: string
}

/** 活动气体排放量TOP3 */
export interface ActivityEmissionRank {
  subCategoryName: string
  activityName: string
  data: number
  ratio: string
}
